﻿<local:StereoControl x:Class="HelixToolkit.AnaglyphView3D"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:HelixToolkit"
    x:Name="thisControl">
    <Grid>
        <Grid Name="LeftPanel" Background="{Binding Background, ElementName=thisControl}">
            <Viewport3D Name="LeftView">
                <Viewport3D.Camera>
                    <PerspectiveCamera/>
                </Viewport3D.Camera>
            </Viewport3D>
        </Grid>

        <Grid Name="RightPanel" Background="{Binding Background, ElementName=thisControl}">
            <Grid.Effect>
                <local:AnaglyphEffect x:Name="AnaglyphEffect1" Method="{Binding Method, ElementName=thisControl}" Offset="{Binding HorizontalOffset, ElementName=thisControl}">
                    <local:AnaglyphEffect.LeftInput>
                        <VisualBrush Visual="{Binding ElementName=LeftPanel}"/>
                    </local:AnaglyphEffect.LeftInput>
                </local:AnaglyphEffect>
            </Grid.Effect>
            <Viewport3D Name="RightView">
                <Viewport3D.Camera>
                    <PerspectiveCamera/>
                </Viewport3D.Camera>
            </Viewport3D>

        </Grid>
        <local:CameraController x:Name="CameraControl" Camera="{Binding Camera, ElementName=thisControl}" 
                                CameraRotationMode="{Binding CameraRotationMode, ElementName=thisControl}"
                                Viewport="{Binding ElementName=LeftView}"/>
    </Grid>
</local:StereoControl>
